Skip to content

Implement core::arch::return_address and tests#154972

Open
chorman0773 wants to merge 3 commits intorust-lang:mainfrom
chorman0773:return_address
Open

Implement core::arch::return_address and tests#154972
chorman0773 wants to merge 3 commits intorust-lang:mainfrom
chorman0773:return_address

Conversation

@chorman0773
Copy link
Copy Markdown
Contributor

@chorman0773 chorman0773 commented Apr 7, 2026

View all comments

Tracking issue: #154966

Implements libs-team#768

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 7, 2026

Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter
gets adapted for the changes, if necessary.

cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Apr 7, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 7, 2026

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @scottmcm, libs
  • @scottmcm, libs expanded to 8 candidates
  • Random selection from Mark-Simulacrum, jhpratt, scottmcm

@rust-log-analyzer

This comment has been minimized.

Comment thread compiler/rustc_codegen_llvm/src/intrinsic.rs
Comment thread library/core/src/intrinsics/mod.rs Outdated
Comment thread library/core/src/arch.rs Outdated
Comment thread library/core/src/intrinsics/mod.rs Outdated
@rust-log-analyzer

This comment has been minimized.

@chorman0773
Copy link
Copy Markdown
Contributor Author

Helpful comment, thanks rustbot 😐

Copy link
Copy Markdown
Member

@Mark-Simulacrum Mark-Simulacrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a huge fan of the doc comment's language. Could you try iterating on it a bit?

I think adding the cranelift implementation in this PR would also make sense (and maybe a gcc backend implementation -- not sure how easy that is?).

r=me with at least the comment fixed.

View changes since this review

Comment thread library/core/src/arch.rs Outdated
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 11, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 11, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 13, 2026

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

@chorman0773
Copy link
Copy Markdown
Contributor Author

chorman0773 commented Apr 13, 2026

I've changed the wording of the comment arround a bit, in part to make it more clear than returning null is something the compiler tries to do if it can't return a useful value for some reason, but doesn't guarantee. I've also added a cranelift impl. I'll figure out gcc/miri in a future PR.

r=@Mark-Simulacrum

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 13, 2026
Comment thread compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs Outdated
@rustbot rustbot assigned bjorn3 and unassigned Mark-Simulacrum Apr 18, 2026
@Mark-Simulacrum
Copy link
Copy Markdown
Member

r=me with commits squashed

r? me

@rust-bors

This comment has been minimized.

* Implement core::arch::return_address and tests

Fix typo

Apply suggestions from code review

Wording/docs changes.

Co-authored-by: Ralf Jung <post@ralfj.de>

Change signature according to Ralf's comment

Fix call to `core::intrinsics::return_address()` according to the new signature

Add cranelift implementation for intrinsic

Change wording on `return_address!()` to be clear that returning a null pointer is best-effort.

Fix formatting of doc comment

Fix mistake in cranelift codegen
* Do not generate llvm.returnaddress on wasm
* Supress return_address test on miri
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 26, 2026

🔨 3 commits were squashed into 4b5d544.

@rust-bors rust-bors Bot force-pushed the return_address branch from ca052d0 to 4b5d544 Compare April 26, 2026 11:56
@Mark-Simulacrum
Copy link
Copy Markdown
Member

@bors r+

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 26, 2026

📌 Commit 4b5d544 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 26, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 26, 2026
…-Simulacrum

Implement `core::arch::return_address` and tests

Tracking issue: rust-lang#154966

Implements libs-team#768
@JonathanBrouwer
Copy link
Copy Markdown
Contributor

JonathanBrouwer commented Apr 26, 2026

@bors r-
#155824 (comment)
(please run a try job for x86_64-gnu-aux before r+'ing)

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 26, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 26, 2026

This pull request was unapproved.

This PR was contained in a rollup (#155824), which was unapproved.

View changes since this unapproval

@chorman0773
Copy link
Copy Markdown
Contributor Author

I don't think I can run try, so I'm just going to ready.

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 3, 2026
@RalfJung
Copy link
Copy Markdown
Member

RalfJung commented May 3, 2026

@bors try jobs=x86_64-gnu-aux

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 3, 2026
Implement `core::arch::return_address` and tests


try-job: x86_64-gnu-aux
@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 3, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 3, 2026

💔 Test for 4c27a6c failed: CI. Failed job:

@rust-log-analyzer

This comment has been minimized.

@RalfJung
Copy link
Copy Markdown
Member

RalfJung commented May 3, 2026

@bors try jobs=x86_64-gnu-aux

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 3, 2026
Implement `core::arch::return_address` and tests


try-job: x86_64-gnu-aux
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 3, 2026

☀️ Try build successful (CI)
Build commit: 8d9d27a (8d9d27a2717522ee5481b673cd72a86424f62ad6, parent: 54f67d248b14af80be8f3adc2094dd4a84ec2115)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants